import fs from 'fs'import path from 'path'import db from './db.json'import { format } from 'prettier'const dbPath = path.resolve('./db.json')export type DBType = typeof dbclass Database {  read(): DBType {    return JSON.parse(fs.readFileSync(dbPath) as unknown as string)  }  write(data: DBType): void {    const writeData = JSON.stringify(data)    void format(writeData, { filepath: '../.prettierrc.json' })      .then((result) => {        fs.writeFileSync(dbPath, result, 'utf-8')      })      .catch()  }}const DB = new Database()export default DB